package thread.state;

/**
 * @program: Multhread
 * @description:
 * @author: zhanghz001
 * @create: 2021-03-04 15:19
 **/
public class BlockedState {
    public static void main(String[] args) throws InterruptedException {
        byte[] lock = new byte[0];
        new Thread(
                () -> {
                    synchronized (lock) {
                        try {
                            Thread.sleep(3000);
                        } catch (Exception e) {
                            e.printStackTrace();
                        } finally {
                            
                        }
                    }
                }
        ).start();
        
        Thread t2 = new Thread(() -> {
            synchronized (lock) {
                
            }
        });
        Thread.sleep(100);
        t2.start();
        Thread.sleep(100);
        System.out.println(t2.getState());
    }
}
